import { IPoint } from "../../ADCore/Interfaces/IRole";
import RandomTools from "../../ADCore/Utils/RandomTools";
import GameWorldConfig from "../../ADCore/Config/GameWorldConfig";

/**移动轨迹设置 */
export default class MoveTrail {
    /**
     * 随机出生点
     * @param w 物体宽度
     * @param h 物体高度
     */
    static randomBornByBall(w: number, h: number,worldWidth?:number): IPoint {
         if(!worldWidth){
            worldWidth=GameWorldConfig.worldWidth;
         } 
        var _x = RandomTools.getRandomCoin() ? -w : w + worldWidth;
        var _y = RandomTools.getRandomNumber(h);
        return { x: _x, y: _y };
    }
}